package com.twu.biblioteca;


import java.util.*;

public class UserRole implements Role {
    Library library;
    LoginManager loginManager;
    LinkedHashMap<Integer, Action> actionList;

    UserRole(Library library, LoginManager loginManager) {
        this.library = library;
        this.loginManager = loginManager;
        actionList = new LinkedHashMap<Integer, Action>();
        actionList.put(1, new ViewAllItems(library,true));
        actionList.put(2, new ViewAllItems(library,false));
        actionList.put(3, new ViewAvailableItems(library,true));
        actionList.put(4, new ViewAvailableItems(library,false));
        actionList.put(5, new CheckOutAnItem(library, loginManager));
        actionList.put(6, new ReturnAnItem(library, loginManager));
        actionList.put(7, new ViewCustomerDetails(library, loginManager));
        actionList.put(8, new Logout(library, loginManager));

    }

    @Override
    public LinkedHashMap<Integer, Action> getActions() {
        return actionList;
    }

    /*@Override
    public LinkedHashMap<Integer, String> getMenuList() {
        LinkedHashMap<Integer,String> menuList=new LinkedHashMap<Integer, String>();
        //Enumeration e = actionList.keys();
        Collection c = actionList.keySet();
        Iterator i = c.iterator();
        while (i.hasNext()) {
            Integer key = (Integer) i.next();
            menuList.put(key,actionList.get(key).printActionName());
        }
        return menuList;
    }*/

}